package com.qf.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.dao.UsersDao;
import com.qf.entity.Users;
import com.qf.service.UsersService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 2019/10/10
 * Administrator
 * springboot1010
 * 面向对象面向君  不负代码不负卿
 */
@Service
public class UsersServiceImpl implements UsersService {
    @Resource
    private UsersDao usersDao;
    @Override
    public List<Users> getall() {
        System.out.println("userservice-------");
        return usersDao.getall();
    }

    @Override
    public PageInfo<Users> getallpage(int pageindex, int pageSize, String name) {
        PageHelper.startPage(pageindex, pageSize);
        List<Users> users = usersDao.getallpage(name);
        return new PageInfo<Users>(users);
    }

    @Override
    public int insertUsers(Users users) {
        return usersDao.insertUsers(users);
    }
}
